import { defineAsyncComponent } from 'vue'

// 路由
import { createRouter, useRouter } from './router'

// 配置
import config from './config'
// 状态
import { store } from '@naturefw/nf-state'

// controller
import projectController from './service/project.js'
import menuController from './service/menu.js'
import mdController from './service/md.js'

// 设置 indexedDB 数据库
import setupIndexedDB from './storage/index.js'
import setupStore from './store/index.js'

// 显示导航
import docNavi from './navi/navi.vue'
// const docNavi = defineAsyncComponent(() => import('./navi/navi.vue'))

// 显示菜单
import docMenu from './menu/menu-show.vue'
// const docMenu = defineAsyncComponent(() => import('./menu/menu-show.vue'))
// 添加、修改菜单
// import menuForm from './menu/form-edit.vue'
const docMenuEdit = defineAsyncComponent(() => import('./menu/menu-edit.vue'))

// 面包屑
import docBreadcrumb from './md/breadcrumb.vue'
// const docBreadcrumb = defineAsyncComponent(() => import('./md/breadcrumb.vue'))

// 编辑文档
// import mdEdit from './md/md-edit.vue'
const mdEdit = defineAsyncComponent(() => import('./md/md-edit.vue'))

// 预览文档
import mdPreview from './md/md-preview.vue'
// const mdPreview = defineAsyncComponent(() => import('./md/md-preview.vue'))

// md 的设置信息
// import getMarkdownEditor from './config/md-edit.js'
// import getMarkdownView from './config/md-view.js'

// 导出
// import mdOutput from './md/md-output.vue'
// import naviOutput from './navi/navi-output.vue'
const mdOutput = defineAsyncComponent(() => import('./md/md-output.vue'))
const naviOutput = defineAsyncComponent(() => import('./navi/navi-output.vue'))

export {
  // controller
  projectController, 
  menuController,
  mdController,
 
  // indexedDB
  setupIndexedDB,
  // 状态
  setupStore,
  // 组件部分
  // 文档
  mdEdit,
  mdPreview,
  // 导出
  mdOutput,
  naviOutput,
  // 导航
  docNavi,
  // 菜单
  docMenu,
  docMenuEdit,
  // 面包屑
  docBreadcrumb,
  // 路由
  createRouter,
  useRouter,
  // 配置
  config,
  // getMarkdownEditor, // 获取 edit 的组件
  // getMarkdownView, // 获取 view 的组件
  // 状态
  store
}